﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="new.aspx.cs" Inherits="AnyOffice.general.sms._new" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>发送内部短信</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<script src="/aspnet_client/core/function.js"></script>
		<script Language="JavaScript">
function CheckForm()
{
   if(document.Form1.ToId.value=="")
   { alert("请添加收信人！");
     return (false);
   }

   if(document.Form1.txtContent.value=="")
   { alert("短信内容不能为空！");
     document.Form1.txtContent.focus();
     return (false);
   }
   
   /*
   if(document.Form1.Content.value.length>100)
   { alert("短信内容最多100个字！");
     return (false);
   }
   */
   
   document.Form1.submit();  
}

function alldept_switch()
{
	if(document.getElementById("AllDept").checked)
	{
		document.getElementById("ToId").value = "ALL_DEPT";
		document.getElementById("ToName").value = "全体成员";
	}
	else
	{
		document.getElementById("ToId").value = "";
		document.getElementById("ToName").value = "";
	}
}

function user_select2(toId, toName)
{
	if(document.getElementById("AllDept").checked)
	{
		document.getElementById("AllDept").checked = false;
		document.getElementById("ToId").value = "";
		document.getElementById("ToName").value = "";		
	}
	user_select(toId, toName);
}

function clear_double2(toId, toName)
{
	document.getElementById("AllDept").checked = false;
	clear_double(toId, toName);
}

function clear_sms()
{
  document.getElementById("txtContent").value="";
}

function CheckSend()
{
  if(event.keyCode==10)
  {
    CheckForm();       
  }
}
		</script>
	</HEAD>
	<body class="bodycolor" topmargin="5">
		<form id="Form1" method="post" runat="server">
			<asp:Panel id="pnlMain" runat="server">
				<TABLE class="small" cellSpacing="0" cellPadding="3" width="100%" border="0">
					<TR>
						<TD class="Big"><IMG src="/images/menu/sms.gif" align="absMiddle"><SPAN class="big3">
								发送内部短信</SPAN>
						</TD>
					</TR>
				</TABLE>
				<TABLE class="small" cellSpacing="1" cellPadding="3" width="500" align="center" bgColor="#000000"
					border="0">
					<TR>
						<TD class="TableHeader">收信人
						</TD>
					</TR>
					<TR>
						<TD class="TableData">
							<INPUT id="ToId" type="hidden" name="ToId" runat="server"> <TEXTAREA class="BigStatic" id="ToName" name="ToName" rows="6" readOnly wrap="yes" cols="50"
								runat="server"></TEXTAREA>&nbsp;<INPUT class="SmallButton" title="添加收信人" onclick="user_select2('ToId','ToName')" type="button"
								value="添 加" name="button">&nbsp;<INPUT class="SmallButton" title="清空收信人" onclick="clear_double2('ToId','ToName')" type="button"
								value="清 空" name="button">
								<BR><input id="AllDept" type="checkbox" name="AllDept" onclick="alldept_switch()">发送至全体成员
						</TD>
					</TR>
					<TR>
						<TD class="TableHeader">短信内容
						</TD>
					</TR>
					<TR>
						<TD class="TableData"><TEXTAREA class="BigInput" onkeypress="CheckSend()" id="txtContent" name="Content" rows="8"
								wrap="on" cols="55" runat="server"></TEXTAREA>&nbsp;<INPUT class="SmallButton" title="清空" onclick="clear_sms();" type="button"
								value="清 空" name="button">
							<BR>按Ctrl+回车键发送消息
						</TD>
					</TR>
					<TR class="TableControl" align="center">
						<TD noWrap colSpan="2"><INPUT class="BigButton" onclick="CheckForm();" type="button" value="发送短信">&nbsp;&nbsp;
							<INPUT class="BigButton" onclick="location='new.aspx'" type="button" value="重填">
						</TD>
					</TR>
				</TABLE>
			</asp:Panel>
			<asp:Panel id="pnlLater" runat="server" Visible="False">
				<asp:Literal id="litMessage" runat="server"></asp:Literal>
				<BR>
				<BR>
				<DIV align="center"><INPUT class="BigButton" onclick="location='new.aspx'" type="button" value="继续发短信" name="button1">
					&nbsp;&nbsp; <INPUT class="BigButton" onclick="location='new.aspx'" type="button" value="返回">
				</DIV>
			</asp:Panel>
		</form>
	</body>
</HTML>
